package com.xoa.controller.knowledge;

import com.xoa.model.knowledge.KnowledgeColumn;
import com.xoa.service.knowledge.ColumnManageService;
import com.xoa.util.LimsJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: ZhuYize
 * @Date: 2020/9/12 15:56
 * @Description: 栏目管理控制器
 */
@Controller
@RequestMapping("/columManage")
public class ColumnManageController {

    @Autowired
    private ColumnManageService columnManageService;


    @RequestMapping("/getColumManagePage")
    public String getColumManagePage() { return "/app/knowledge/columnManager/column"; }


    /**
     * @Author: ZhuYize
     * @Date: 2020/9/14 13:09
     * @Description: 添加栏目分类
     * @param: knowledgeColumn 添加的数据
     * @return: LimsJson
     */
    @RequestMapping("/insertKnowledgeType")
    @ResponseBody
    public LimsJson insertKnowledgeType(KnowledgeColumn knowledgeColumn) {

        return columnManageService.insertKnowledgeType(knowledgeColumn);
    }


    /**
     * @Author: ZhuYize
     * @Date: 2020/9/14 15:01
     * @Description: 修改栏目类别
     * @param: knowledgeColumn 修改的数据
     * @return: LimsJson
     */
    @RequestMapping("/updateKnowledgeType")
    @ResponseBody
    public LimsJson updateKnowledgeType(KnowledgeColumn knowledgeColumn) {

        return columnManageService.updateKnowledgeType(knowledgeColumn);
    }


    /**
     * @Author: ZhuYize
     * @Date: 2020/9/14 18:32
     * @Description: 获取栏目类别详情
     * @param: columnId 栏目类别id
     * @return: LimsJson
     */
    @RequestMapping("/selectKnowledgeType")
    @ResponseBody
    public LimsJson selectKnowledgeType(Integer columnId) {

        return columnManageService.selectKnowledgeType(columnId);
    }
}
